﻿using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Security.Cryptography;
using WebApplication1.Entity;
using yunbo.Model.SSM;
using yunbo.Repositorys.SSMRepositorys;

namespace yunbo.Controllers.SSMControllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class MenuController : Controller
    {
        MenuRepository menuRepositorys = new MenuRepository();


        [HttpGet("GetMenus")]
        public IActionResult GetMenus()
        {
            List <MenuNode> quans = menuRepositorys.GetTree();
            return Ok(quans);
        }

        [HttpGet("GetMenuName")]
        public IActionResult GetMenuName(int Menu_pid)
        {
            string name = menuRepositorys.GetMenuName(Menu_pid);
            return Ok(name);
        }
    }
}
